package com.yzt.zhuju.network.entity.user;

import com.yzt.zhuju.RXingUtils;

/**
 * author : bob
 * date   : 2022/11/29
 * desc   :
 */
public class UserLoginInfo {

    public static final String EVENT_TYPE_LOGIN = "login";

    /**
     * login：登录；register：注册
     */
    private String event;

    // 是否已实名
    private boolean authed;

    // 是否已补充信息
    private boolean edited;

    // 登录凭证token
    private String token;

    private String rongToken;

    private LoginInfo userInfo = new LoginInfo();

    public String getEvent() {
        return event;
    }

    public void setEvent(String event) {
        this.event = event;
    }

    public LoginInfo getUserInfo() {
        return userInfo;
    }

    public void setUserInfo(LoginInfo userInfo) {
        this.userInfo = userInfo;
    }

    public boolean isAuthed() {
        return authed;
    }

    public void setAuthed(boolean authed) {
        this.authed = authed;
    }

    public boolean isEdited() {
        return edited;
    }

    public void setEdited(boolean edited) {
        this.edited = edited;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getRongToken() {
        return rongToken;
    }

    public void setRongToken(String rongToken) {
        this.rongToken = rongToken;
    }

    @Override
    public String toString() {
        return "UserLoginInfo{" +
                "event='" + event + '\'' +
                ", authed=" + authed +
                ", edited=" + edited +
                ", token='" + token + '\'' +
                ", rongToken='" + rongToken + '\'' +
                ", userInfo=" + userInfo +
                '}';
    }

    public static class LoginInfo {
        private String title;
        //性别
        private Integer gender = -1;//	int	男女 0男 1女
        //uid
        private Integer uid;
        private String userName;
        private String avatar;
        private String rongappid;
        private String mobile;//手机号

        private boolean isPhoneLogin; // 是否是手机号登录

        public boolean isPhoneLogin() {
            return isPhoneLogin;
        }

        public void setPhoneLogin(boolean phoneLogin) {
            isPhoneLogin = phoneLogin;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public Integer getGender() {
            if (gender == null || gender == -1) {
                gender = RXingUtils.getGender();
            }
            return gender;
        }

        public void setGender(Integer gender) {
            this.gender = gender;
        }

        public Integer getUid() {
            return uid;
        }

        public void setUid(Integer uid) {
            this.uid = uid;
        }

        public String getUserName() {
            return userName;
        }

        public void setUserName(String userName) {
            this.userName = userName;
        }

        public String getAvatar() {
            return avatar;
        }

        public void setAvatar(String avatar) {
            this.avatar = avatar;
        }

        public String getRongappid() {
            return rongappid;
        }

        public void setRongappid(String rongappid) {
            this.rongappid = rongappid;
        }

        public String getMobile() {
            return mobile;
        }

        public void setMobile(String mobile) {
            this.mobile = mobile;
        }

        @Override
        public String toString() {
            return "LoginInfo{" +
                    "title='" + title + '\'' +
                    ", gender=" + gender +
                    ", uid=" + uid +
                    ", userName='" + userName + '\'' +
                    ", avatar='" + avatar + '\'' +
                    ", rongappid='" + rongappid + '\'' +
                    ", mobile='" + mobile + '\'' +
                    ", isPhoneLogin=" + isPhoneLogin +
                    '}';
        }
    }
}

